package com.zoke.loveway.ui;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.lidroid.xutils.ViewUtils;
import com.zoke.loveway.R;
import com.zoke.loveway.utils.MoeToast;
import com.zoke.loveway.utils.PageState;
import com.zoke.loveway.utils.ScreenManager;
import com.zoke.loveway.utils.TitleManager;
import com.zoke.support.base.BaseActivity;

/**
 * 基类
 * 
 * @author Jack
 *
 */
public class LoveWayUI extends BaseActivity {

	protected TitleManager mTitle;
	protected PageState mPagestate;
	// 界面获取
	protected static Context mContext;

	public static void open(Intent intent) {
		// 增加动画或者其他
		mContext.startActivity(intent);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mContext = this;
		ViewUtils.inject(this);
		mTitle = new TitleManager(this);
		mPagestate = new PageState(this);
		ScreenManager.getScreenManager().pushActivity(this);
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		ScreenManager.getScreenManager().popActivity(this);
	}

	@Override
	protected void doubleExitStarted() {
		// 土司提示
		MoeToast.show(getApplicationContext(), R.string.toast_doubleExit);
	}

}
